<?php
/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2018/10/31
 * Time: 10:00
 */

namespace app\index\model;


use think\Model;

class Region extends Model
{
    public function getCityAttr($value)
    {
        return model("Region")->field("Id as id,Name as name,ZipCode as zipcode,Id as district")->where("ParentId", $value)->select();
    }

    public function getDistrictAttr($value)
    {
        return model("Region")->field("Id as id,Name as name,ZipCode as zipcode,Id as area")->where("ParentId", $value)->select();
    }

    public function getAreaAttr($value)
    {
        return model("Region")->field("Id as id,Name as name,ZipCode as zipcode")->where("ParentId", $value)->select();
    }
}